{% extends "base.html" %}
{%block main %}
<div id= "register" class="container">
  {% if form.non_field_errors %}
  <div class="messages">
    <div class="alert alert-warning alert-dismissible" role="alert">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      {{ form.non_field_errors }}
    </div>
  </div>
  {% endif %}
  <div class="register center-block">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><strong>注册</strong></h3>
      </div>
      <div class="panel-body">
        <form action="" method="post">{% csrf_token %}
          <div class="form-group {% if form.username.errors %} has-error {% endif %}">
            <label for="">{{ form.username.label }}</label>
            {% if form.username.errors %}
            <span class="text-danger pull-right">{{ form.username.errors }}</span>
            {% endif %}
            {{ form.username }}
            <p class="text-muted">{{ form.username.help_text }}</p>
          </div>
          <div class="form-group {% if form.email.errors %} has-error {% endif %}">
            <label for="">{{ form.email.label }}</label>
            {% if form.email.errors %}
            <span class="text-danger pull-right">{{ form.email.errors }}</span>
            {% endif %}
            {{ form.email }}
            <p class="text-muted">{{ form.email.help_text }}</p>
          </div>
          <div class="form-group {% if form.password.errors %} has-error {% endif %}">
            <label for="">{{ form.password.label }}</label>
            {% if form.password.errors %}
            <span class="text-danger pull-right">{{ form.password.errors }}</span>
            {% endif %}
            {{ form.password }}
            <p class="text-muted">{{ form.password.help_text }}</p>
          </div>
          <button type="submit" class="btn btn-default">注 册</button>
        </form>
      </div>
    </div>
  </div>
</div>
{% endblock %}
